package com.ncs.nc.controller;

import com.ncs.nc.entity.GoodsType;
import com.ncs.nc.entity.ResultObject;
import com.ncs.nc.service.GoodsTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/goodsType")
@CrossOrigin
public class GoodsTypeController {

    @Autowired
    private GoodsTypeService gts;
    @Autowired
    private ResultObject ro;

    @RequestMapping("/all")
    public ResultObject getTypes(){
        ro.setMsg("success");
        ro.setData(gts.list());
        return ro;
    }





}
